import { defHttp } from '@/utils/http/axios';


enum Api {
  GET_DOCTOR_LIST = `/hospital/medical_workers`,
  GET_WECHAT_MP_JS_CONFIG = `/wechat/mp/jsconfig?url=`,
  docGetFaceToken = "/user/register/medical_workers/faceToken",
}


export const getDoctorList = ({ name, page = 0, size = 20 }) => {
  return defHttp.getYYTApi({
    url: Api.GET_DOCTOR_LIST,
    params: {
      page,
      size,
      query: (name ? `name:${name} ` : '') + 'enabled:true AUDIT_STATUS:PASS'
    }
  });
};



export const docGetFaceToken = (data) => {
  return defHttp.getYYTApi({
    url: Api.docGetFaceToken,
    params: data
  })
}


export const getWechatMpJsConfig = (url = location.href) => {
  return defHttp.getYYTApi({
    url: Api.GET_WECHAT_MP_JS_CONFIG + encodeURIComponent(url),
  });
};